<template>
  <div>
    <Modal v-model="confirmPop" width="35" class-name="vertical-center-modal" :mask-closable="false">
      <!-- 页头 -->
      <div slot="header" class="header-title">{{ $t('wayBill.yes_confirm') }}</div>
      <!-- 内容 -->
      <div class="content-sty">{{ $t('custom.confirm_pop_text') }}</div>
      <!-- 底部 -->
      <div slot="footer" class="footer-wrap">
        <div class="cancel-text" @click="confirmPop = false">{{ $t('pay.cancel') }}</div>
        <div class="submit-text" @click="referBtn">{{ $t('transport.submit') }}</div>
      </div>
    </Modal>
  </div>
</template>
<script>
import { cancelSer } from "@/api/order";
export default {
  props: {
    isType: Number,
    cancelId: String
  },
  data() {
    return {
      confirmPop: false,
      cancelForm: {}
    }
  },
  methods: {
    open() {
      this.confirmPop = true;
    },
    // 确认
    referBtn() {
      this.cancelForm.serviceType = this.isType;
      this.cancelForm.id = this.cancelId;
      cancelSer(this.cancelForm).then(res => {
        if (res.code == 200) {
          this.confirmPop = false;
          this.$emit('updateServiceMet');
        }
      })
    }
  }
}
</script>

<style lang="less" scoped>
:deep(.ivu-modal-header) {
  border: none;
  padding: 42px 44px 38px;
}

:deep(.ivu-modal-body) {
  padding: 0 44px;
}

:deep(.ivu-modal-footer) {
  border: none;
  padding: 44px 44px 25px 44px;
  text-align: left;
}

:deep(.ivu-modal-close) {
  position: absolute;
  top: 32px;
  right: 43px;
}

:deep(.ivu-modal-close .ivu-icon-ios-close) {
  color: #333333;
  font-size: 48px;
  font-weight: 600;
}

.vertical-center-modal {
  display: flex;
  align-items: center;
  justify-content: center;

  .header-title {
    font-family: Open Sans, Open Sans;
    font-weight: 600;
    font-size: 20px;
    color: #333333;
    line-height: 23px;
  }

  .content-sty {
    font-family: Open Sans, Open Sans;
    font-weight: 500;
    font-size: 20px;
    color: #333333;
    line-height: 23px;
  }

  .footer-wrap {
    display: flex;
    justify-content: end;
    gap: 24px;

    .cancel-text {
      padding: 11px 40px;
      border-radius: 8px 8px 8px 8px;
      border: 1px solid #E5E5E5;
      font-family: Open Sans, Open Sans;
      font-weight: 400;
      font-size: 18px;
      color: #AEB0B9;
      line-height: 20px;
      cursor: pointer;
    }

    .submit-text {
      padding: 11px 40px;
      background: #FF186B;
      border-radius: 8px 8px 8px 8px;
      font-family: PingFang SC, PingFang SC;
      font-weight: 400;
      font-size: 18px;
      color: #FFFFFF;
      line-height: 20px;
      cursor: pointer;
    }
  }
}
</style>
